package fr.ginvest.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Entity implementation class for Entity: Commentaire
 *
 */
@Entity
@Table(name = "commentaire")
public class Commentaire implements Serializable {   
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Long id;
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name="id_article", referencedColumnName="id", nullable=false)
	private Article article;
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name="id_investisseur", referencedColumnName="id", nullable=false)
	private Investisseur investisseur;
	
	@Temporal(TemporalType.DATE)
	private java.util.Date dateCreation;
	
	@Column(length=5000)
	private String libelle;
	
	private static final long serialVersionUID = 1L;

	public Commentaire() {
		super();
	}   
	public Commentaire(String libelle) {
		super();
		this.libelle = libelle;
		this.dateCreation = new Date();
	}
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	public Article getArticle() {
		return this.article;
	}

	public void setArticle(Article article) {
		this.article = article;
	}
   
	public java.util.Date getDateCreation() {
		return dateCreation;
	}
	
	public void setDateCreation(java.util.Date dateCreation) {
		this.dateCreation = dateCreation;
	}
	
	public Investisseur getInvestisseur() {
		return this.investisseur;
	}

	public void setInvestisseur(Investisseur investisseur) {
		this.investisseur = investisseur;
	}
	
	public void setLibelle(String libelle) {
		this.libelle = libelle;
	}
   
	public String getLibelle() {
		return libelle;
	}
}
